//
//  ViewController.m
//  UI16_CollectionViewCycleImage
//
//  Created by dllo on 16/8/4.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "ViewController.h"
#import "CycleImage.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//     Do any additional setup after loading the view, typically from a nib.
    // 当写了storyboard时 执行- (instancetype)initWithCoder:(NSCoder *)aDecoder 初始化
    CycleImage *cycle = [[CycleImage alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 370)];
    [self.view addSubview:cycle];
    
    NSMutableArray *array = [NSMutableArray array];
    for (NSInteger i = 0; i < 5; i++) {
        [array addObject:[NSString stringWithFormat:@"%ld", i]];
    }
    NSString *firstImage = [array firstObject];
    NSString *last = [array lastObject];
    [array insertObject:last atIndex:0];
    [array addObject:firstImage];
    cycle.array = array;
    cycle.titleLabel.text = @"sdasds";
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
